class SearchesController < ApplicationController
	def show
		unless params[:q].blank?
			@search_text = CGI.escapeHTML(params[:q])
			
			page = params[:page]
			page ||= 1
			page = 1 if page.to_i == 0
   		
   		@entries = ThinkingSphinx::Search.search @search_text, :per_page=>20, :page=>page
		end
		@entries ||= []
		@entries.compact!
	end
end
